<?php
$web = \yii\helpers\Url::base();
?>
<script type="text/javascript" src="<?= $web ?>/js/jcrop/jcrop.single.js"></script>
<script type="text/javascript">
    function clickFile() {
        $("#uploadImg").click();
    }
</script>
<iframe id="good_detail_partial_form_target" name="good_detail_partial_form_target" style="display: none"></iframe>
<form id="good_detail_partial_form" enctype="multipart/form-data" method="post" action="group-save-handler"
      target="good_detail_partial_form_target">
    <input type="hidden" id="group_id" name="group_id" value="<?= $id ?>">
    <div class="form-horizontal">
        <div class="form-group">
            <label class="col-lg-3 col-sm-3 control-label">群组名称：</label>
            <div class="col-lg-9">
                <input type="text" class="form-control" autofocus id="group_name" name="group_name"
                    <?php
                    if ($item != null) {
                        echo "value='" . $item['name'] . "'";
                    } ?>
                />
            </div>
        </div>
        <!--上次群组头像Begin-->
        <div class="form-group">
            <label class="col-lg-3 col-sm-3 control-label">群组头像：</label>
            <div class="col-lg-9">
                <div class="uploadImg" style="display: none;">
                    <input class="upload-img-box" type="file" onchange="previewSingleChange(this,1,1)"
                           name="uploadImg" id="uploadImg">
                </div>
                <a href="javascript:clickFile()" class="btn btn-warning">选择图片</a>
            </div>
        </div>
        <div class="form-group">
            <div class="col-lg-12">
                <label class="col-lg-3 col-sm-3 control-label"></label>
                <div class="col-lg-9">
                    <div id="imgSingle_Sure">
                        <div>
                            <input type="hidden" id="show_image_id" name="show_image_id"
                                   value="<?= isset($item['show_image']) ? $item['show_image']['id'] : '' ?>">
                            <?php if (isset($item['show_image'])): ?>
                                <img src="<?= $item['show_image']['url'] ?>" style="width: 200px">
                            <?php endif ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--上次群组头像End-->
        <div class="form-group">
            <label class="col-lg-3 col-sm-3 control-label">备注：</label>
            <div class="col-lg-9">
            <textarea class="form-control" id="group_remark" name="group_remark"><?php
                if ($item != null) {
                    echo $item['remark'];
                } ?></textarea>
            </div>
        </div>
    </div>
</form>